package wc.controller.factory;

import java.util.ArrayList;
import java.util.List;

import wc.model.component.Component;
import wc.model.component.ShoeStore;
import wc.model.component.Store;
import wc.model.component.roomcomponent.RoomComponent;
import wc.model.grid.TileGrid;

public class ShoeStoreFactory extends StoreFactory {
	static StoreFactory instance;
	
	private ShoeStoreFactory() {
		scf = ShoeStoreComponentFactory.getInstance();
	}
	
	public static StoreFactory getInstance() {
		if(instance == null) {
			instance = new ShoeStoreFactory();
		}
		return instance;
	}

	@Override
	public Store creatStore(int width, int height) {
		TileGrid<Component> relativeLocations = new TileGrid<Component>(width, height);
		TileGrid<RoomComponent> roomComponents = new TileGrid<RoomComponent>(width, height);
		List<RoomComponent> mustPlaceComponents = new ArrayList<RoomComponent>();
		mustPlaceComponents.add(scf.createCashRegister());
		mustPlaceComponents.add(scf.createStoreDoor());
		mustPlaceComponents.add(scf.createStoreShelf());
		Store store = new ShoeStore(relativeLocations, roomComponents, mustPlaceComponents);
		relativeLocations.setComponent(store);
		return store;
	}
}
